subject: PCG2.EXE overview: Section 5.7 in Part II described how to identify the data to be graphed in a PC-Type II file. The identified information is placed in a file named GRAPH.ME and saved to your default directory. PC-Type II then calls PCG2 to begin execution. PCG2 displays a graph based on the information in GRAPH.ME. Upon exiting PCG2, you are returned to PC-Type II, editing the file which was active when you started the graph. This section describes how to use PCG2, and also provides a description of each type of data line contained in a GRAPH.ME file. You do not have to be inside PC-Type II to start PCG2. As long as a GRAPH.ME file exists in your default directory, you can run PCG2 at any time from DOS by typing PCG2 after the DOS prompt and then pressing the Enter key. If PCG2 cannot find a GRAPH.ME in your default directory, it will display a message to this effect. The GRAPH.ME file can be edited by PC-Type II. You do not have to go through the process of identifying all the data elements again and creating a new GRAPH.ME file. After running PCG2, you may discover a small file named "PCG2.ASP" on your disk. PCG2 looks for this file when it begins. It contains the colors you have selected and the aspect ratios you defined for your screen and your printer. (More about colors and aspect ratios later.) PCG2 first looks for PCG2.ASP in the default directory. If it cannot find it there, (and you are running under DOS version 3.0 or later), it will look for it in the directory in which PCG2.EXE is located. NOTE: If PCG2.ASP is not found, then upon entering PCG2 you will be asked to define some aspect ratios. (See the section on Aspect Ratios defined under the PIE menu line options.) The graphing capabilities of PCG2 are especially powerful, because they allow you to summarize large volumes of data into a quickly understood picture. Here are some graphs that were produced with PCG2 via PC-Type II. Please refer to these sample graphs in the discussion that follows. 254 These types of graphs can be produced: Line graphs (see graph A ) Horizontal bar charts (see chart B ) Vertical bar charts (see chart C ) Overlapping bar charts (see chart K ) Pie charts (see charts D and J) Cumulative bar and line graphs (see graphs F and G) Scatter diagrams (see diagrams E and L) In addition, most of the graphs permit you to display a line showing the average of the data. Smoothed (moving) averages can also be drawn on many of the graphs. This can be extremely useful for indicating trends that wouldn't otherwise show up due to wide fluctuations in individual data points. (See graph L.) A projection line (regression line) can be drawn with your graph. This is a straight line that represents the best fit to your data. The method of least squares is used to compute the formula for the line. (See graph E.) A logarithmic scale is an option available for line and bar charts. (See graph H.) Devices supported by PC-Type II graphics include: CGA adapter EGA adapter VGA adapter Hercules compatible monochrome graphics card Epson (FX) style dot matrix printers Epson (MX) / IBM style dot matrix printers Okidata dot matrix printers HP Laserjet printers If your computer has only an IBM monochrome monitor (without a Hercules compatible monochrome card), you cannot use the graphing features of PC-Type II. NOTE: If you use a Hercules monochrome graphics, card, then you must run the program MSHERC.COM before running PCG2. (See the description "Hercules" on page 282.) 255 the menu: When you first enter PCG2, the type of graph specified in the GRAPH.ME file (e.g., pie chart, line graph, bar chart, etc.) will be displayed on your screen. In the lower right-hand corner of your screen will be the message: (press M for menu) The options available for each type of graph are displayed in a menu occupying the bottom two lines of your screen. Since this area is shared by the graph itself, the menu can be "turned off" to enable you to see what the graph looks like on these lines as well. When the menu is turned off, the message above is displayed. The M key acts as a toggle to turn the option menu on and off. After pressing the M key, you should see two menu lines at the bottom of the graph. NOTE: If you have run GRAPHICS.COM (supplied with DOS), and wish to perform a PrntScreen of your graphics screen, you may wish to get rid of the "(press M for menu)" reminder as well. You can do this by pressing Shift F1. If you do so, the M key will still act as a toggle, but the "(press M for menu)" reminder will no longer be displayed. The top menu line, the GENERAL line, is the same for all graphs. It looks like: GENERAL: (O)utput(C)olor (M)enu (Q)uit (P)ie (L)ine (H)bar (V)bar (S)catter The bottom menu line varies, depending on what type of graph is currently displayed, or which mode (e.g. cumulative) is active. To select a menu option, press the key indicated by the letter within the parentheses. NOTE:Additional messages are presented in the menu area when you set up to print your graph, modify the color selections, and define the aspect ratio for your screen and printer. 256 subject: GENERAL MENU LINE OPTIONS discussion: Each option available in the GENERAL menu line shown on the preceding page will be discussed in turn. (O)utput: This command is used to print the graph. When you press the O key, the following menu is displayed: Press P for Portrait (upright) L for Landscape (sideways) Q or Esc to cancel Here you define the orientation of the printed output. Selecting Portrait (upright), will cause the graph to be printed straight up and down. The size of this output is smaller than if you select the Landscape option. The Landscape option will print your graph rotated by 90 degrees, and is fairly close to the size you would want for making view foils. After selecting the output orientation, a new menu is displayed: Press E for Epson (Q or Esc to Cancel) I for IBM L for Laserjet O for Okidata from which you select the type of printer you are using. For Epson MX compatible printers, press I. For Epson FX compatible printers, press E. For Okidata printers in IBM mode, press I. For Okidata mode, press O. After you select the appropriate printer, the menu lines will be removed from the screen until the graph has been printed. As the graph is printing, the screen colors will change to their "negative" colors to show the progress of the printing process. When printing is completed, the graph will be redrawn and the main menu redisplayed (depending upon the state of the M toggle.) NOTE: If you are printing a Pie chart, it will be redrawn when you select the orientation of the output. The aspect ration defined for the selected orientation will be used. 257 (C)olor: Some colors may not show up clearly on your screen. The Color command allows you to select those colors which show up best and also permits you to select the foreground and background colors. Your selections will be saved in the file PCG2.ASP so you will not have to redefine them every time you use PCG2. NOTE: If your graphs are displayed in black and white, the "(C)olor" option will have no effect. PCG2 attempts to provide you with the maximum resolution your graphics adapter will support. For this reason, CGA will always be displayed in black and white, even though your monitor can display colors. EGA and VGA can display color. When you press C a screen like the one below will be displayed: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ 1ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Y ³ ³ .ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ . ³ ³ .ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ . ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ nÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Y ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Press F to change foreground color Q to exit color selection Press B to change background color 1-n to toggle display colors First set the foreground and background colors to your taste by repeatedly pressing the F and B keys. (Whenever F or B is pressed, the colors displayed inside the box will change and the selection toggles (Y/N) will all be set to Y). Next press the number keys 1, 2, .. n, (n is normally 6 or 7) to toggle the detail color selection. If an "N" is displayed in the box, the color for the corresponding number has been turned OFF and you will not be able to see the color at all. Press the corresponding number again to turn it back on. When you are finished, press Q. Only those colors displayed will be used in your graphs. In some circumstances, the full range of colors for EGA or VGA adapters cannot be supported and you may have to run PCG2 in CGA mode. To do this you cannot invoke PCG2 from within PC-Type II but must start it from DOS with the "force CGA" parameter, /F. For example: C>pcg2 /F NOTE: Make sure that you erase PCG2.ASP which contains color defaults before using the /F parameter. 258 (M)enu: This command removes the menu lines from the screen. If you press the M key a second time, the menu lines will be displayed again. (When you print the graph, the menu lines will be removed for you automatically.) When the menu lines are not displayed, the message "(press M for menu)" is shown at the lower-right of your screen. You can press Shift F1 to remove this message. (Q)uit: The Quit command stops PCG2 execution. If PCG2 was begun from inside PC-Type II, you are returned to PC-Type II. If you initiated PCG2 from DOS, you are returned to DOS. 259 (S)catter: Pressing the S key from the Main Menu produces a scatter diagram (points are not connected). (See sample diagrams E and L.) The second line of the Main Menu will be: SCATTER: (B)ound (T)-log (G)rid (X)chg (A)vg (F)it (0-9)-Smoothed Avg (B)ound: If a "BOUND" record exists in the GRAPH.ME file, pressing the B key will toggle the axes of the scatter diagram between their normal values and those specified in the "BOUND" record. If no "BOUND" record exists, this option will not be displayed and only the normal values for the axes will be available. (T)-log: Pressing the T key toggles the scaling of the vertical axis of the diagram between an arithmetic scale and a logarithmic scale. (G)rid: Pressing the G key toggles the presence or absence of grid lines to be placed on the diagram. (X)chg: Pressing the X key swaps the elements of multiple variables and their group designations. It is only available in diagrams with multiple variables. For example, if each group of data was represented by a year, and each element of a group was a type of fruit, the (X)chg command would cause each group to be a type of fruit and each element of a group to be a year. (E.g.: Sample charts C and I use the same data. Chart I was produced by issuing the (X)chg command when viewing chart C.) (A)vg: Pressing the A key will cause an average (or mean) line to be superimposed on the diagram for each group of data points being displayed. (F)it: Pressing the F key will cause a "least squares" regression line to be superimposed on the diagram for each group of data points being displayed. (Normally used to display trends. See sample graph E). Smoothed Avg: Pressing any of the number keys, 0 through 9, causes a smoothed average line to be superimposed on your diagram for each group of data points being displayed. This shows trends for data which varies substantially. The number you select controls the amount of smoothing used. For example, if you press 2, then 2 data points in a group to the left, the current point, and 2 data points in a group to the right will be averaged for each plotted point. The higher the number you choose, the greater the amount of smoothing. (Sample diagram L was produced selecting 1 for smoothing.) 260 (L)ine: When you press the L key for the GENERAL line of the Main Menu, a line graph is displayed. See sample graphs A, F and H. The second line of the Main Menu will be: LINE: (B)ound (T)-log (G)rid (X)chg c(U)m (A)vg (F)it (0-9)-Smoothed Avg (B)ound: If a "BOUND" record exists in the GRAPH.ME file, pressing the B key will toggle the axes of the line graph between their normal values and those specified in the "BOUND" record. If no "BOUND" record exists, this option will not be displayed and only the normal values for the axes will be available. (T)-log: Pressing the T key toggles the scaling of the vertical axis of the graph between an arithmetic scale and a logarithmic scale. (If the c(U)m option is active, logarithmic scaling is suspended and the T key will have no effect.) (G)rid: Pressing the G key toggles the presence or absence of grid lines to be placed on the graph. (X)chg: Pressing the X key swaps the elements of multiple variables and their group designations. It is only available in graphs with multiple variables. (See the explanation of (X)chg on the previous page for further details.) c(U)m: Pressing the U key produces cumulative graphs and is most useful when graphing multiple variables. The Y value of the points for each group at a given position on the X axis are totaled to produce this graph. Logarithmic scaling is not available for this type of display. Sample graph F is a cumulative graph made from graph A. (A)vg: Pressing the A key will cause an average (or mean) line to be superimposed on the graph for each group of data points being displayed. (F)it: Pressing the F key will cause a "least squares" regression line to be superimposed on the graph for each group of data points being displayed. (Normally used to display trends. See sample graph E.) Smoothed Avg: Pressing any of the number keys, 0 through 9, causes a smoothed average line to be superimposed on your graph for each group of data points being displayed. This shows trends for data which varies substantially. (See the explanation for Smoothed Avg on the previous page for further details.) 261 (H)bar: When you press the H key from the GENERAL line of the Main Menu, a horizontal bar chart is drawn. See sample chart B. (V)bar: When you press the V key from the GENERAL line of the Main Menu, a vertical bar chart is drawn. See sample charts C, K, and G. The second line of the Main Menu will be: BAR: (B)ound (T)-log (G)rid (X)chg c(U)m (A)vg ov(E)rlap (B)ound: If a "BOUND" record exists in the GRAPH.ME file, pressing the B key will toggle the axes of the bar chart between their normal values and those specified in the "BOUND" record. If no "BOUND" record exists, this option will not be displayed and only the normal values for the axes will be available. (T)-log: Pressing the T key toggles the scaling of the vertical axis of the chart between an arithmetic scale and a logarithmic scale. (If the c(U)m option is active, logarithmic scaling is suspended and the T key will have no effect.) (G)rid: Pressing the G key toggles the presence or absence of grid lines to be placed on the chart. (X)chg: Pressing the X key swaps the elements of multiple variables and their group designations. It is only available in charts with multiple variables. (See the explanation of (X)chg in the discussion of scatter diagrams for further details.) c(U)m: Pressing the U key produces stacked bar charts and is most useful when charting multiple variables. The "ov(E)rlap" option and logarithmic scaling are not available for this type of display. Sample chart G is a cumulative chart made from chart C. (A)vg: Pressing the A key will cause an average (or mean) line to be superimposed on the chart for each group of data being displayed. ov(E)rlap: Pressing the E key causes the bars (within a group) to overlap. This option is not available if the bar chart being displayed is in the cumulative mode. Sample chart K is an overlapped bar chart, made by issuing the overlap command while viewing chart C. 262 (P)ie: When you press P from the GENERAL line of the Main Menu, a pie chart will be drawn. Sample charts D and J were produced with the Pie command. The second line of the Main Menu will be: PIE: (A)spect (W)edge (D)isp (X)chg (1-2)#pies (N)ext group (A)spect: Pressing the A key permits you to change the aspect ratio used for displaying and printing pie charts. The aspect ratio is the relationship between the density of vertical and horizontal pixels on your screen or dot positions on your printer. If this ratio is not correct, pies will appear elliptical instead of round. When you press A, a new screen will be presented which displays a "circle" inside a "square". A short horizontal line also appears inside the circle. A new menu is also shown: SCREEN: Press Q when done. Press P/L for Portrait/Landscape Press <- to shrink (Hz/Vert) ->v to grow (Hz/Vert) Pressing Q returns you to your normal display. The "circle" displayed upon entry to this screen shows the way a circle will look on your monitor. You should adjust the horizontal and vertical dimensions (using the arrow keys) until the "circle" appears round and the "square" appears square. The left arrow will reduce the horizontal width. The right arrow will increase the horizontal width. The up arrow will reduce the vertical height. The down arrow will increase the vertical height. You should also set the aspect ratio for your printer for both portrait (upright) and landscape (sideways) printing. Press P or L and this menu will appear: PRINTER: Press Q when satisfied. Press P to print image. Press <- to shrink (Hz/Vert) ->v to grow (Hz/Vert) Pressing Q returns you to the previous menu. Arrow keys adjust the shapes as before, and P activates the printer menu discussed under "(O)utput". Setting the printer aspect ratio requires a number of iterations. Press P, select your printer, and see what shape the "circle" has when it is printed. (The line inside the circle should help you differentiate between vertical and horizontal on your screen vs vertical and horizontal on your printed output.) 263 Use the arrow keys to adjust the shape accordingly and try printing again. Repeat this process until the "circle" appears round when printed. (It will probably appear elliptical on your screen.) Once it appears round, press Q and then repeat the process for the other print orientation (portrait or landscape). These aspect ratios will be saved in the file PCG2.ASP so you will not have to go through this process every time you run the program. (W)edge: Pressing W will bring up a new screen in which you can define which wedges to pull away from the center of the pie for emphasis. (Your selection(s) will apply to all pies.) The following instructions are displayed in the menu area: As each slice is made solid, press D to detach, A to attach or S to skip. Press N to return all slices to pie or Q to terminate operation. A pie is drawn containing a section for each group of data. The first "slice" of the pie is displayed with a solid color. Pressing: D - causes the solid slice to be (D)etached. A - causes the solid slice to be (A)ttached. S - (S)kips the solid slice and moves to the next one. N - returns all detached slices to the center of the pie and exits the wedge option. Q - (Q)uits the slice definition. All modifications are in effect. If the circuit of slices around the pie is completed before you press Q, the wedge option is complete and you are returned to your normal pie display. (D)isp: Pressing D toggles the label display between: (1) headings and percents by their slices. (2) headings next to legend - percents next to slices. (3) headings and percents next to legend. Compare sample charts D and J. (1-2) #pies: If there are multiple groups to be processed, pressing 2 will display two pie charts side-by-side. Pressing 1 will display only one. (N)ext group: If there are multiple groups to be processed, there will be more pies to view than are visible on one screen. Pressing N will cycle through the additional pies, either one, or two at a time (depending on the selection made for (1-2)). 264 subject: GRAPH.ME The GRAPH.ME file created by PC-Type II contains a number of different types of records to define the data to be graphed and where to return upon completion of PCG2. This file can be edited directly if desired. The following describes each type of record and its format. The sample GRAPH.ME file below and the graph which it produces will be referred to in this discussion. PARMS:L PORT:LPT2 TITLE:Comparative Intnl Sales TITLES:(By city & Month) TITLEV:Sales in $ TITLEC:Months TITLEG:Cities TITLEG:Philly TITLEG:Montreal TITLEG:Paris TITLEG:Moscow TITLEG:Redmond TITLEG:Lima TITLEG:Bonn 10,20,30,40,100,60,20:Jan 50,80,20,15,30,110,33:Feb 22,-10,40,60,15,99,122:Mar ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ Comparative Intnl Sales ³ ³ (By city & Month) ³ ³ 125 ´ . ³ ³ ³ Cities ³ ³ S 100 ´ . . . .. Philly ³ ³ a ³ . .. Montreal ³ ³ l 75 ´ .. Paris ³ ³ e ³ . Data points . .. Moscow ³ ³ s 50 ´ . . .. Redmond ³ ³ ³ . . . .. Lima ³ ³ i 25 ´ . . .. Bonn ³ ³ n ³ . . . ³ ³ 0 ´ ³ ³ $ ³ . ³ ³ -25 ÁÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄ ³ ³ Jan Feb Mar ³ ³ ³ ³ Months ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ NOTE:‹Any record in GRAPH.ME which begins with an * in ‹column 1 will be treated as a comment line. 265 PARMS: (optional record) format - PARMS:t example - PARMS:L This record describes which type of graph, chart, etc. should be displayed when you first enter PCG2. If this record is omitted, PCG2 defaults to the vertical bar chart display. Valid options for t are: V - vertical bar chart H - horizontal bar chart L - line graph S - scatter diagram P - pie chart TITLE: (optional record) format - TITLE:string example - TITLE:Comparative Intnl Sales The title record contains the text (up to 40 characters) which is displayed as the primary title of the graph. If omitted, no title will be displayed. TITLES: (optional record) format - TITLES:string example - TITLES:(By city & Month) The subtitle record contains the text (up to 40 characters) which is displayed as the secondary title of the graph. If omitted, no subtitle will be displayed. TITLEV: (optional record) format - TITLEV:string example - TITLEV:Sales in $ The value header record describes the data values being graphed. The text can be up to 20 characters in length. In a scatter diagram or line graph it is displayed vertically to the left of the Y axis. If it is omitted, no value heading will be displayed. TITLEC: (optional record) format - TITLEC:string example - TITLEC:Months The category title record contains the text (up to 12 characters in length) describing the distinction between each group of data. In a scatter diagram or line graph it is displayed below the X axis labels. 266 TITLEG: (optional record) format - TITLEG:string:string: .. :string example - TITLEG:Cities:Philly The group header record(s) contain the text (up to 12 characters per header) describing each element of a group. There can be multiple TITLEG records, and they are assumed to be in the proper order. Each text string should be separated by a colon. Do not place a colon after the last element on the record. NOTE: The first string is used to describe the entities within a group, hence the headers for each group element are offset by one. BOUND: (optional record) format - BOUND:xh,xl,yh,yl,0,ch example - BOUND:3.4,1,122,-10,0,358 The BOUND record permits you to specify the maximum and minimum bounds for the X and Y axes. This is useful when preparing a group of charts in which you want the axes to reflect identical scaling for comparative purposes. This record is normally inserted in GRAPH.ME manually. When present, it enables the "(B)ound" option on the second menu line for most graphs. xh - maximum Xvalue xl - minimum Xvalue yh - maximum Yvalue yl - minimum Yvalue ch - maximum Cumulative value 267 data record: (required) format - vi1, .., vin:string {*} or - vi1, .., vin:#x {*} example - 10,20,30,40,100,60,20:Jan or - 10,20,30,40,100,60,20:#1. * Each data record represents one category spanning all groups. vij - a numeric value representing the ith element in the jth group. If there are n groups being graphed, then there must be n vij's (separated by commas) in each data record. string - up to 12 characters defining the ith element. #x - implies that the numeric value x is to be interpreted as a value, not as text. These values are used on the X-axis only. If the "(X)chg" option is used, this "value" option is not transferred. This permits you to plot data which is not equidistant on the X axis. * - this optional parameter specifies that the ith element is to be detached from each pie. It can be overridden within PCG2. It is not transferred with the "(X)chg" option. (1) This record may require more than one line in GRAPH.ME. If a line is to be continued, it should end with the backslash character \. (2) Each data record MUST have the same number of data elements. (3) The colon is required. Any record which does not contain a colon will be ignored. (4) The two types of data records (x-value or string) cannot be mixed within the same GRAPH.ME file. (5) Data records must be in order. If the data records are of the "#x" type, they must be in ascending order. PORT: (optional) format -¯PORT:filespec example -¯PORT:COM1 The PORT record defines the port (or file) to which the graphics output will be sent when printing a graph. If this record is not included in the GRAPH.ME file, the standard output port will be used (LPT1). NOTE: If the /p= parameter is used when starting PCG2, the PORT: record will be ignored. (See page 282.) 268 Hercules: If you have a Hercules compatible graphics card and a monochrome monitor, you must run a special program before you can produce graphs. The program is called MSHERC.COM. It was placed on your hard disk when you installed PC-Type II. MSHERC.COM only needs to be run once each time you boot up your computer. You run it directly from DOS. Most people prefer to put the command MSHERC directly in their AUTOEXEC.BAT file so that it is run automatically for them each time they turn on their computer. problems: If you have trouble getting a graph on your screen, investigate the following: (1) The program PCG2.EXE must be somewhere on the DOS path. (2) You must have a monitor and video adapter card that is capable of producing graphics. The IBM monochrome monitor without a Hercules graphics card is not capable of producing graphs. (3) If you have a Hercules graphics card and monochrome monitor, you must run the program MSHERC before PCG2 can be activated. (4) If some data does not seem to appear in your graphs, try adjusting the (C)olor option. If the problem persists, run PCG2 from DOS using the /F parameter. port parm: Normally PCG2 will send the printed output to LPT1, the standard output port. If your graphics printer is connected to a different output port, you can send the output to that port by using the "PORT:" record inside your GRAPH.ME file, or by invoking PCG2 with the parameter: /P=filespec. E.g., C>PCG2 /P=COM1 The /P= parameter overrides the "PORT:" record. NOTE: If you include a GR_PORT: record in your PCTYPE.PRO profile file, then the output specified on that record will be used to create a "PORT:" record in the GRAPH.ME file created by PC-Type II. 269